package com.kidback.bbloc259.ui;

import android.graphics.Color;
import android.view.Gravity;
import android.view.View;

import androidx.annotation.NonNull;

import com.kidback.bbloc259.base.BaseActivity;
import com.kidback.bbloc259.base.lang.Delay;
import com.kidback.bbloc259.base.lang.Runnable0;
import com.kidback.bbloc259.databinding.ActivityNotificationBinding;
import com.kidback.bbloc259.util.StatusBarUtils;
import com.kidback.bbloc259.util.TipUtils;
import com.scwang.smart.refresh.layout.api.RefreshLayout;
import com.scwang.smart.refresh.layout.listener.OnRefreshListener;

public class NotificationActivity extends BaseActivity<ActivityNotificationBinding> {

    @Override
    public ActivityNotificationBinding getViewBinding() {
        return ActivityNotificationBinding.inflate(inflater);
    }

    @Override
    protected void initView() {
        StatusBarUtils.setStatusBarColor(activity, 0xff715af3);

        viewBinding.titleBar.setTintColor(Color.WHITE);
        viewBinding.titleBar.setTitle("消息通知");

        viewBinding.titleBar.setOnBackClickListener(onBackClickListener);


        viewBinding.refreshLayout.setOnRefreshListener(new OnRefreshListener() {
            @Override
            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
                loadNetData();
            }
        });

        viewBinding.refreshLayout.autoRefresh();
    }

    @Override
    protected void loadData() {



    }

    private void loadNetData(){
        Delay.delay(2000, new Runnable0() {
            @Override
            public void run() {

                TipUtils.showMsgDuration(activity, "暂无数据", Gravity.CENTER, 1500);
                viewBinding.imgNoData.setVisibility(View.VISIBLE);
                viewBinding.refreshLayout.finishRefresh();
            }
        });
    }

}
